<template>
  <div class="hello" style="border:1px solid red">
  <h2>Hello world组件</h2>

    <h1 @click="onClick">我是按钮</h1>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: {
      type: Array
    }
  },
  methods: {
    onClick() {
      // 发布订阅模式
      this.$emit('toParent','传值')
    }
  },
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
